package designPattern.composite;

public abstract class OrganizationCompoment {

    private String name;
    private String des;

    public OrganizationCompoment(String name, String des) {
        this.name = name;
        this.des = des;
    }

    //为什么不写抽象方法：叶子节点不需要重写这两个方法
    protected void add(OrganizationCompoment organizationCompoment){
        //默认实现
        throw new UnsupportedOperationException();
    }

    protected void remove(OrganizationCompoment organizationCompoment){
        //默认实现
        throw new UnsupportedOperationException();
    }

    //做成抽象
    protected abstract void print();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }
}
